﻿namespace Community.CsharpSqlite.Entity
{
    /*
    ** A linked list of the following structures is stored at BtShared.pLock.
    ** Locks are added (or upgraded from LockType.READ_LOCK to LockType.WRITE_LOCK) when a cursor 
    ** is opened on the table with root page BtShared.iTable. Locks are removed
    ** from this list when a transaction is committed or rolled back, or when
    ** a btree handle is closed.
    */

    public class BtLock
    {
        private byte eLock; /* LockType.READ_LOCK or LockType.WRITE_LOCK */
        private uint iTable; /* Root page of table */
        private Btree pBtree; /* Btree handle holding this lock */
        private BtLock pNext; /* Next in BtShared.pLock list */
    };
}